package com.li.dao;

import com.li.po.User;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;

import java.util.List;

public class UserDaoImpl implements UserDao{
    private SqlSessionFactory sqlSessionFactory;
    public UserDaoImpl(SqlSessionFactory sqlSessionFactory){
        this.sqlSessionFactory=sqlSessionFactory;
    }
    @Override
    public List<User> findAll() {

        SqlSession sqlSession= sqlSessionFactory.openSession();
        List<User> list=sqlSession.selectList("userMapper.selectAll");
        return list;
    }
}
